home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 335_03 / as8051.txt < prev    next >
Text File  |  1990-12-02  |  9KB  |  463 lines

  1.  
  2.  
  3.  
  4.                                   - 1 -
  5.  
  6.  
  7.  
  8.        A.  Appendix_for_as8051_Frankenstein_Assembler
  9.  
  10.        A.1  Pseudo_Operations
  11.  
  12.        A.1.1  Standard_Pseudo_Operation_Mnemonics
  13.  
  14.             End                                END
  15.             File Inclusion                     INCL INCLUDE
  16.             If                                 IF
  17.             Else                               ELSE
  18.             End If                             ENDI
  19.             Equate                             EQU
  20.             Set                                SET
  21.             Org                                ORG
  22.             Reserve Memory                     RESERVE RMB
  23.             Define Byte Data                   BYTE DB FCB
  24.             Define Word Data                   DW FDB WORD
  25.             Define String Data                 FCC STRING
  26.             Define Character Set Translation   CHARSET
  27.             Define Character Value             CHARDEF CHD
  28.             Use Character Translation          CHARUSE
  29.  
  30.        A.1.2  Machine_Dependent_Pseudo_Operations
  31.  
  32.        A.1.2.1  Define_Word_Data  The Define Word Data pseudo-
  33.        operations generate the byte reversed form for 16 bit
  34.        constants.  The first byte is the low order half, followed
  35.        by the high order byte.
  36.  
  37.        A.2  Instructions
  38.  
  39.        A.2.1  Instruction_List
  40.  
  41.        Opcode   Syntax                          Selection Criteria
  42.  
  43.  
  44.        ACALL    expr
  45.  
  46.        ADD      A ',' '#' expr
  47.        ADD      A ',' '@' REG                   R01
  48.        ADD      A ',' REG                       R07
  49.        ADD      A ',' expr
  50.  
  51.        ADDC     A ',' '#' expr
  52.        ADDC     A ',' '@' REG                   R01
  53.        ADDC     A ',' REG                       R07
  54.        ADDC     A ',' expr
  55.  
  56.        AJMP     expr
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                   - 2 -
  71.  
  72.  
  73.  
  74.        Opcode   Syntax                          Selection Criteria
  75.  
  76.  
  77.        ANL      A ',' '#' expr
  78.        ANL      A ',' '@' REG                   R01
  79.        ANL      A ',' REG                       R07
  80.        ANL      A ',' expr
  81.        ANL      C ',' '/' bit
  82.        ANL      C ',' '/' expr
  83.        ANL      C ',' bit
  84.        ANL      C ',' expr
  85.        ANL      expr ',' '#' expr
  86.        ANL      expr ','A
  87.  
  88.        CJNE     A ',' '#' expr ',' expr
  89.        CJNE     A ',' expr ',' expr
  90.        CJNE     '@' REG ',' '#' expr ',' expr   R01
  91.        CJNE     REG ',' '#' expr ',' expr       R07
  92.  
  93.        CLR      A
  94.        CLR      C
  95.        CLR      bit
  96.        CLR      expr
  97.  
  98.        CPL      A
  99.        CPL      C
  100.        CPL      bit
  101.        CPL      expr
  102.  
  103.        DA       A
  104.  
  105.        DEC      '@' REG                         R01
  106.        DEC      A
  107.        DEC      REG                             R07
  108.        DEC      expr
  109.  
  110.        DIV      AB
  111.  
  112.        DJNZ     REG ',' expr                    R07
  113.        DJNZ     expr ',' expr
  114.  
  115.        INC      '@' REG                         R01
  116.        INC      A
  117.        INC      DPTR
  118.        INC      REG                             R07
  119.        INC      expr
  120.  
  121.        JB       bit ',' expr
  122.        JB       expr ',' expr
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                   - 3 -
  137.  
  138.  
  139.  
  140.        Opcode   Syntax                          Selection Criteria
  141.  
  142.  
  143.        JBC      bit ',' expr
  144.        JBC      expr ',' expr
  145.  
  146.        JC       expr
  147.  
  148.        JMP      '@' A '+' DPTR
  149.  
  150.        JNB      bit ',' expr
  151.        JNB      expr ',' expr
  152.  
  153.        JNC      expr
  154.  
  155.        JNZ      expr
  156.  
  157.        JZ       expr
  158.  
  159.        LCALL    expr
  160.  
  161.        LJMP     expr
  162.  
  163.        MOV      '@' REG ',' '#' expr            R01
  164.        MOV      '@' REG ',' A                   R01
  165.        MOV      '@' REG ',' expr                R01
  166.        MOV      A ',' '#' expr
  167.        MOV      A ',' '@' REG                   R01
  168.        MOV      A ',' REG                       R07
  169.        MOV      A ',' expr
  170.        MOV      C ',' bit
  171.        MOV      C ',' expr
  172.        MOV      DPTR ',' '#' expr
  173.        MOV      REG ',' A                       R07
  174.        MOV      REG ',' '#' expr                R07
  175.        MOV      REG ',' expr                    R07
  176.        MOV      bit ',' C
  177.        MOV      expr ',' '#' expr
  178.        MOV      expr ',' '@' REG                R01
  179.        MOV      expr ',' A
  180.        MOV      expr ',' C
  181.        MOV      expr ',' REG                    R07
  182.        MOV      expr ',' expr
  183.  
  184.        MOVC     A ',' '@' A '+' DPTR
  185.        MOVC     A ',' '@' A '+' PC
  186.  
  187.        MOVX     '@' DPTR ',' A
  188.        MOVX     '@' REG ',' A                   R01
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                   - 4 -
  203.  
  204.  
  205.  
  206.        Opcode   Syntax                          Selection Criteria
  207.  
  208.        MOVX     A ',' '@' DPTR
  209.        MOVX     A ',' '@' REG                   R01
  210.  
  211.        MUL      AB
  212.  
  213.        NOP
  214.  
  215.        ORL      A ',' '#' expr
  216.        ORL      A ',' '@' REG                   R01
  217.        ORL      A ',' REG                       R07
  218.        ORL      A ',' expr
  219.        ORL      C ',' '/' bit
  220.        ORL      C ',' '/' expr
  221.        ORL      C ',' bit
  222.        ORL      C ',' expr
  223.        ORL      expr ',' '#' expr
  224.        ORL      expr ',' A
  225.  
  226.        POP      expr
  227.  
  228.        PUSH     expr
  229.  
  230.        RET
  231.  
  232.        RETI
  233.  
  234.        RL       A
  235.  
  236.        RLC      A
  237.  
  238.        RR       A
  239.  
  240.        RRC      A
  241.  
  242.        SETB     C
  243.        SETB     bit
  244.        SETB     expr
  245.  
  246.        SJMP     expr
  247.  
  248.        SUBB     A ',' '#' expr
  249.        SUBB     A ',' '@' REG                   R01
  250.        SUBB     A ',' REG                       R07
  251.        SUBB     A ',' expr
  252.  
  253.        SWAP     A
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                   - 5 -
  269.  
  270.  
  271.  
  272.        Opcode   Syntax                          Selection Criteria
  273.  
  274.        XCH      A ',' '@' REG                   R01
  275.        XCH      A ',' REG                       R07
  276.        XCH      A ',' expr
  277.  
  278.        XCHD     A ',' '@' REG                   R01
  279.  
  280.        XRL      A ',' '#' expr
  281.        XRL      A ',' '@' REG                   R01
  282.        XRL      A ',' REG                       R07
  283.        XRL      A ',' expr
  284.        XRL      expr ',' '#' expr
  285.        XRL      expr ',' A
  286.  
  287.        A.2.2  Selection_Criteria_Keywords
  288.  
  289.             R01                 Only the reserved symbols R0 and R1
  290.                                 (or r0, r1) are acceptable as the
  291.                                 REG operand.
  292.  
  293.             R07                 All the reserved symbols R0 thru R7
  294.                                 are acceptable as the REG operand.
  295.  
  296.        A.2.3  Bit_Operands  Bit Addresses can be in two forms.
  297.  
  298.        One form is "expression.constant" where expression gives an
  299.        address for a bit addressable register and constant (in the
  300.        range of 0 to 7) gives the bit number in the byte.
  301.        Expression values must be either in the range of 20h to 2fh,
  302.        or the multiples of 8 between 80h and f8h, and defined in
  303.        the first pass.
  304.  
  305.        The second form is an symbolic expression with value between
  306.        0 and 255.  The value of the expression is placed in the
  307.        operand field of the instruction without modification.
  308.  
  309.        A.2.4  Apostrophes  The apostrophes in the syntax field are
  310.        a notation used for the parser generator and are not put in
  311.        the assembler source statement.
  312.  
  313.        A.3  Notes
  314.  
  315.        A.3.1  Address_Spaces  The Four address spaces, Program
  316.        Memory, Internal Data Memory, Bit Numbers, and External Data
  317.        Memory are not differentiated in the symbol table.  Which
  318.        address space a symbol refers to is determined by the
  319.        context of the instruction operands it appears in.
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                                   - 6 -
  335.  
  336.  
  337.  
  338.        A.3.2  Reserved_Symbols
  339.  
  340.        A.3.2.1  Machine_Dependent_Reserved_Symbols  A AB C DPTR PC
  341.        R0 R1 R2 R3 R4 R5 R6 R7 a ab c dptr pc r0 r1 r2 r3 r4 r5 r6
  342.        r7
  343.  
  344.        A.3.2.2  Standard_Reserved_Symbols  AND DEFINED EQ GE GT
  345.        HIGH LE LOW LT MOD NE NOT OR SHL SHR XOR and defined eq ge
  346.        gt high le low lt mod ne not or shl shr xo